//https://webpack.js.org/guides/
//https://github.com/TypeStrong/ts-loader
module.exports = {
    entry: {
        "vuedemo": './ts/vuedemo/vuedemo.ts',
        "demo": './ts/vuedemo/deno1.ts'
    },
    output: {
        filename: '[name].js',
        path: __dirname + '/js/dev'
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                //和默认的tsconfig.json有差别的地方
                loader: 'ts-loader?' + JSON.stringify({
                    configFileName : 'tsconfig_webpack.json'
                }),
                options: {
                    appendTsSuffixTo: [/\.vue$/]
                },
                exclude: /node_modules/
            },
            {
                test: /\.vue$/,
                loader: 'vue-loader',
                options: {
                    esModule: true
                },
                exclude: /node_modules/
            }
        ]
    },
    resolve: {
        extensions: [".tsx", ".ts", ".js"]
    },

    externals: {
        "Vue": "Vue"
    }
};
